import request from '@/utils/request'

// 改变当前图书的状态
export function changeBookStatus(data) {
  return request({
    url: '/library/book/changeBookStatus',
    method: 'post',
    data: data
  })
}

// 条件分页查询
export function pageBook(query) {
  return request({
    url: '/library/book/page',
    method: 'get',
    params: query
  })
}

// 查询图书馆-图书列表
export function listBook(query) {
  return request({
    url: '/library/book/list',
    method: 'get',
    params: query
  })
}

// 查询图书馆-图书详细
export function getBook(libBookId) {
  return request({
    url: '/library/book/' + libBookId,
    method: 'get'
  })
}

// 新增图书馆-图书
export function addBook(data) {
  return request({
    url: '/library/book',
    method: 'post',
    data: data
  })
}

// 修改图书馆-图书
export function updateBook(data) {
  return request({
    url: '/library/book',
    method: 'put',
    data: data
  })
}

// 删除图书馆-图书
export function delBook(libBookId) {
  return request({
    url: '/library/book/' + libBookId,
    method: 'delete'
  })
}
